<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <f:view>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Actividadpypes PYP</title>
            <link type="text/css" href="../common/css/redmond/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/administrar.css" rel="stylesheet" />
            
            <!--<script type="text/javascript" src="../common/js/jquery-1.4.2.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery.ui.all.js"></script>
            <script type="text/javascript" src="../common/js/jquery.layout.js"></script>
            <script type="text/javascript" src="../common/js/jquery-ui-1.8.6.custom.min.js"></script>-->
            
             <script type="text/javascript" src="../common/js/jquery-1.8.0.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery-ui-1.8.23.custom.min.js"></script>
            
            <script type="text/javascript" src="../common/js/calendarioui-es.js"></script>
            <script type="text/javascript" src="../common/js/jquery.dateentry.js"></script>
            <script type="text/javascript" src="../common/js/configuracion_actividadpyp.js"></script>
            <script type="text/javascript" src="../common/js/jquery.tablesorter.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery.metadata.js"></script>
            <script type="text/javascript" src="../common/js/jquery.tablesorter.pager.js"></script>
            <script type="text/javascript" src="../common/js/jquery.validate.js"></script>
            <script type="text/javascript" src="../common/js/jquery.numeric.js"></script>
            <script type="text/javascript" src="../common/js/jquery.qtip-1.0.0-rc3.js"></script>
            <style type="text/css" title="currentStyle">
                @import "../common/css/demo_page.css";			
                @import "../common/css/demo_table_jui.css";
            </style>
            <script type="text/javascript" language="javascript" src="../common/js/jquery.dataTables.js"></script>

            <script>
                var asInitVals = new Array();

                $(document).ready(function() {
                    var oTable = $('#example').dataTable( {
                        "sPaginationType": "full_numbers",
                        "bJQueryUI": true,
                        "bProcessing": true,
                        "bServerSide": true,
                        "sAjaxSource": "/salus/ActividadpypListaServlet",
                        "oLanguage": {
                            "sLengthMenu": "Mostrar _MENU_ registros por Pagina",
                            "sZeroRecords": "Opps - No se encontraron datos",
                            "sInfo": "Mostrando _START_ a _END_ de _TOTAL_ registros",
                            "sInfoEmpty": "Mostrando 0 a 0 de 0 registros",
                            "sInfoFiltered": "(filtered from _MAX_ total records)"
                        }

                    } );

                    $("tfoot input").keyup( function () {
                        /* Filter on the column (the index) of this element */
                        oTable.fnFilter( this.value, $("tfoot input").index(this) );
                    } );

                    $("tfoot input").each( function (i) {
                        asInitVals[i] = this.value;
                    } );

                    $("tfoot input").focus( function () {
                        if ( this.className == "search_init" )
                        {
                            this.className = "";
                            this.value = "";
                        }
                    } );

                    $("tfoot input").blur( function (i) {
                        if ( this.value == "" )
                        {
                            this.className = "search_init";
                            this.value = asInitVals[$("tfoot input").index(this)];
                        }
                    } );                               
                    $("#example tbody").dblclick(function(event) {
                        $(oTable.fnSettings().aoData).each(function (){
                            $(this.nTr).removeClass('row_selected');
                        });
                        $(event.target.parentNode).addClass('row_selected');
                        var anSelected = fnGetSelected( oTable );                                        
                        var dato=anSelected[0].cells;                                        
                        editar(dato[0].innerHTML,dato[1].innerHTML)
                    });
                    /* Add a click handler for the delete row */
                    $('#delete').click( function() {
                        var anSelected = fnGetSelected( oTable );
                        //oTable.fnDeleteRow( anSelected[0] );
                        var dato=anSelected[0].cells;
                        alert(dato[0].innerHTML);
                    } );
                } );
                function fnGetSelected( oTableLocal )
                {
                    var aReturn = new Array();
                    var aTrs = oTableLocal.fnGetNodes();

                    for ( var i=0 ; i &lt; aTrs.length ; i++ )
                    {
                        if ( $(aTrs[i]).hasClass('row_selected') )
                        {
                            aReturn.push( aTrs[i] );
                        }
                    }
                    return aReturn;
                }

            </script>


        </head>
        <body>
            <div style="width: 100%">

                <h3 style="text-align: center" class="ui-widget-header">Actividades PYP</h3>


                <table width="100%">
                    <tr>
                        <td align="left">
                            <button id="nuevaActividadpypBtn">Nuevo</button>
                        </td>
                        <td align="right">
                            <button id="ayudaBtn">Ayuda</button>               
                        </td>
                    </tr>
                </table>                

                <div class="tooltips"></div>


                <!--DATA TABLE-->                
                <div id="dynamic">
                    <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                        <thead>
                            <tr>
                                <th width="5%">Sec</th>
                                <th width="10%">C&oacute;digo</th>
                                <th width="65%">Descripci&oacute;n</th>       
                                <th width="20%">Programa</th>       
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="3" class="dataTables_empty">Loading data from server</td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>                                
                                <th><input size="20" type="hidden" name="search_id" value="Secuencial" class="search_init" /></th>
                                <th><input type="text" onkeyup="this.value=this.value.toUpperCase()" name="search_numero" value="Numero" class="search_init" /></th>
                                <th><input type="text" onkeyup="this.value=this.value.toUpperCase()" name="search_descripcion" value="Descripci&oacute;n" class="search_init" /></th>                                
                                <th><input type="text" onkeyup="this.value=this.value.toUpperCase()" name="search_programa" value="Programa" class="search_init" /></th>                                
                            </tr>
                        </tfoot>
                    </table>
                </div>

            </div>


            <div id="actividadpyp-form" title="Info" style="display: none">

                <form id="formActividadpyp">

                    <input type="hidden" id="op"/>

                    <table class="ui-widget-content" width="100">                      

                        <tr>
                            <td>Programa PYP</td>                   
                        </tr>

                        <tr>
                            <td>
                                <select id="id_programapyp" style="width: 610px" name="id_programapyp" class="text ui-widget-content"></select>
                            </td>                            
                        </tr>    


                        <tr> 
                            <td>Actividad</td>
                        </tr>

                        <tr>
                            <td>
                                <table>
                                    <tr>
                                        <td>
                                            <input type="text" size="10" ondblclick="buscarActividadCodigo()" maxlength="20" id="codact" name="codact" value=""/>
                                        </td>

                                        <td>
                                            <img src="../common/img/case.png" onclick="buscarActividadCodigo()" style="cursor: pointer" styleClass="icon" />
                                            <input type="hidden" id="id_actividad" name="id_actividad" value=""/>

                                        </td>

                                        <td>
                                            <input type="text" size="54" readonly="true" id="desact"  name="desact" value=""/>

                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <table>
                                    <tr>
                                        <tr> 
                                            <td>C&oacute;digo</td>
                                            <td colspan="2">Descripci&oacute;n</td>

                                        </tr>

                                        <td>
                                            <input type="text" size="10" maxlength="20" id="codigo" name="codigo" value=""/>
                                             <span id="error_num"></span>
                                        </td>

                                        <td>

                                        </td>

                                        <td>
                                            <input type="text" size="56"  id="descripcion" name="descripcion" value=""/>

                                        </td>

                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table>
                                    <tr>

                                        <tr>                            
                                            <td>C&oacute;digo CUPS</td>  
                                            <td>C&oacute;digo SOAT</td>  

                                        </tr>

                                        <tr>
                                            <td>                                
                                                <input type="text" size="10"  id="id_actcups" name="id_actcups" value=""/>   
                                            </td>
                                            <td>                                
                                                <input type="text" size="10"  id="id_actsoat" name="id_actsoat" value=""/>   
                                            </td>

                                        </tr>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table>
                                    <tr>

                                        <tr>
                                            <td>Finalidad Consulta</td>
                                            <td>Finalidad Procedimiento</td>
                                        </tr>  

                                        <tr>
                                            <td>
                                                <select id="id_fincn" style="width: 300px" name="id_fincn" class="text ui-widget-content"></select>
                                            </td>
                                            <td>
                                                <select id="id_finpx" style="width: 300px" name="id_finpx" class="text ui-widget-content"></select>
                                            </td>

                                        </tr>
                                    </tr>
                                </table>
                            </td>
                        </tr> 
                        <tr>
                            <td>Diagn&oacute;stico Principal</td>
                        </tr>    
                        <tr>
                            <td>
                                <input type="hidden" size="30" name="id_diagnostico" id="id_diagnostico" value="0" class="ui-widget-content" ondblclick="this.value='';$('#id_diagnostico').val('')" />
                                <input type="text" size="72" onkeyup="lookup(this.value,17);" onblur="fill17();" id="des_diagnostico" value="" class="ui-widget-content" />
                                <div class="suggestionsBox" id="suggestions" style="display: none;">
                                    <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                    <div class="suggestionList" id="autoSuggestionsList">
                                        &nbsp;
                                    </div>
                                </div>
                            </td>
                        </tr>

                        <tr>

                            <td>
                                <table>
                                    <tr>
                                        <td colspan="2">Edad Inicial</td>
                                        <td colspan="2">Edad Final</td>
                                        <td>Sexo</td>
                                        <td>Habilitada</td>
                                    </tr>   
                                    <tr>

                                        <td>
                                            <input type="text" size="6" name="edad1" id="edad1" value="" class="ui-widget-content" />
                                        </td>
                                        <td>
                                            <select id="medida1" name="medida1" class="text ui-widget-content">
                                                <option value="A">A&ntilde;os</option>
                                                <option value="M">Meses</option>
                                                <option value="D">D&iacute;as</option>
                                            </select>
                                        </td>

                                        <td>
                                            <input type="text" size="6" name="edad2" id="edad2" value="" class="ui-widget-content" />
                                        </td>
                                        <td>
                                            <select id="medida2" name="medida2" class="text ui-widget-content">
                                                <option value="A">A&ntilde;os</option>
                                                <option value="M">Meses</option>
                                                <option value="D">D&iacute;as</option>
                                            </select>
                                        </td>

                                        <td>
                                            <select id="sexo" name="sexo" class="text ui-widget-content" style="width: 235px">
                                                <option value="1">MASCULINO</option>
                                                <option value="2">FEMENINO</option>
                                                <option selected="true" value="3">APLICA AMBOS</option>
                                            </select>
                                        </td>

                                        <td align="center" class="ui-widget-header">                                                           
                                            <input type="checkbox" id="habilitada" name="habilitada"/>
                                            <input type="hidden" id="vhabilitada" value="Off" name="vhabilitada"/>
                                        </td>

                                    </tr>
                                </table>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <table>
                                    <tr>
                                        <td colspan="3">Esquema</td>
                                        <td>Sesi&oacute;n</td>
                                    </tr>   
                                    <tr>

                                        <td>Cantidad</td>
                                        <td>Durante</td>
                                        <td>A&ntilde;os</td>                                        
                                        <td>Cantidad</td>


                                    </tr>                                    
                                    <tr>
                                        <td>
                                            <input type="text" size="6" name="frecuencia" id="frecuencia" value="" class="ui-widget-content" />
                                        </td>

                                        <td>
                                            <input type="text" size="6" name="cantidad" id="cantidad" value="" class="ui-widget-content" />
                                        </td>

                                        <td>
                                            <select id="tiempo" name="tiempo" class="text ui-widget-content">
                                                <option value="A">A&ntilde;os</option>
                                                <option value="M">Meses</option>
                                                <option value="D">D&iacute;as</option>
                                            </select>
                                        </td>

                                        <td>
                                            <input type="text" size="43" name="frecuencia_sesion" id="frecuencia_sesion" value="" class="ui-widget-content" />
                                        </td>

                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>

                </form>

                <!--Buscar Actividades-->
                <div id="dialogoBuscarActividad" style="display: none" title="ACTIVIDADES">
                    <br />
                    <div id="busquedaDiv">
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>C&oacute;digo</td>
                                <td>
                                    <input type="text" onkeyup="this.value=this.value.toUpperCase()" id="codigoBusq" size="16" maxlength="16"/>
                                </td>
                                <td>Descripci&oacute;n</td>
                                <td>
                                    <input type="text" onkeyup="this.value=this.value.toUpperCase()" id="descBusq" size="45" maxlength="45"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" align="center">
                                    <input class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"  id="buscar" type="button" value="Buscar"/>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="datos" style="display: none">
                    </div>

                </div>



            </div>
            <div class="qtip qtip-stylename">
                <div class="qtip-tip" rel="cornerValue"></div>
                <div class="qtip-wrapper">
                    <div class="qtip-borderTop"></div>
                    <div class="qtip-contentWrapper">
                        <div class="qtip-title">
                            <div class="qtip-button"></div>
                        </div>
                        <div class="qtip-content"></div>
                    </div>
                    <div class="qtip-borderBottom"></div>
                </div>
            </div>

        </body>
    </f:view>
</html>
